package com.lin.sms.dao.util;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.lin.sms.domain.User;

public class UserRowMapper implements RowMapper<User> {

	@Override
	public User mapRow(ResultSet rs, int rowNum) throws SQLException {
		User user = new User();
		user.setName(rs.getString("name"));
		user.setPassword(rs.getString("password"));
		user.setClassId(rs.getString("classId"));
		return user;
	}
	 public static RowMapper<User> getRowMapper(){
		 RowMapper<User> rowMapper = new UserRowMapper();
		return rowMapper;
	 }
}
